﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BonsaiScrum.Core.Domain;
using System.Reflection;

namespace BonsaiScrum.Tests
{
    public static class ObjectExtensions
    {
        public static object Field(this object o, string fieldName)
        {
            var fieldInfo = o.GetType().GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance);

            return (fieldInfo != null) ? fieldInfo.GetValue(o) : null;
        }
    }
}
